package com.mss.media.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mss.media.entity.AdminPermissions;
import com.mss.media.mapper.AdminPermissionsMapper;
import com.mss.media.service.IAdminPermissionsService;
import com.mss.media.util.abnormal.MssException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * @Author 湫
 * @Date 2021/12/3 16:29
 * Name IAdminPermissionsServiceImpl
 */
@Service
public class IAdminPermissionsServiceImpl extends ServiceImpl<AdminPermissionsMapper, AdminPermissions> implements IAdminPermissionsService {

    @Autowired
    private AdminPermissionsMapper adminPermissionsMapper;

    @Override
    public Set<String> showPermissions(Integer adminRoleId) {
        if (adminRoleId == null) {
            throw new MssException("系统错误");
        }
        Set<String> strings = adminPermissionsMapper.showPermissions(adminRoleId);
        return strings;
    }
}
